<?php if (! defined('APPPATH')) die('No direct script access allowed');


class ModelbuilderController extends RtiController
{
	public function __construct()
	{
		if (ENVIRONMENT === ENVIRONMENT_PRODUCTION)
		{
			die ('Access is denied [ENVIRONMENT]');
		}
	}
	
	public function index()
	{
		Rti::loadView('page_modelbuilder');
	}
	
	public function build()
	{
		Rti::loadHelper('RtiModelBuilder');
		
		$alias = Rti::input()->get('alias');
		$key   = Rti::input()->get('key');
		
		if ($key == Rti::config('config')->get('MODELBUILDER_KEY'))
		{
			$builder = RtiModelBuilder::build($alias);		
		}
		else 
		{
			echo "Access is denied [MODELBUILDER_KEY]";
		}
	}
}